package cn.iocoder.yudao.module.yyzx.dal.mysql.cfood;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.yyzx.dal.dataobject.cfood.CFoodDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.yyzx.controller.admin.cfood.vo.*;

/**
 * 客户膳食信息 Mapper
 *
 * @author jzh
 */
@Mapper
public interface CFoodMapper extends BaseMapperX<CFoodDO> {

    default PageResult<CFoodDO> selectPage(CFoodPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CFoodDO>()
                .eqIfPresent(CFoodDO::getCustomerid, reqVO.getCustomerid())
                .eqIfPresent(CFoodDO::getFoodid, reqVO.getFoodid())
                .betweenIfPresent(CFoodDO::getFooddate, reqVO.getFooddate())
                .eqIfPresent(CFoodDO::getFoodweek, reqVO.getFoodweek())
                .betweenIfPresent(CFoodDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CFoodDO::getId));
    }

}